package org.dtrd.modules.flup.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.flup.entity.bean.FlupTemplateDetail;


/**
 * <p>
 * 复诊模版
 * </p>
 *
 * @author QR
 * @since 2021-12-21
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_flup_template")
public class DtrdEntRdFlupTemplate {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 机构编码
     */
    @TableField("org_code")
    private String orgCode;

    /**
     * 服务包名字
     */
    @TableField("template_name")
    private String templateName;

    /**
     * 服务描述
     */
    @TableField("package_desc")
    private String packageDesc;

    @TableField("create_time")
    private Date createTime;

    @TableField("update_time")
    private Date updateTime;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    public DtrdEntRdFlupTemplate init() {
        createTime = new Date();
        isDel = 0;
        return this;
    }

    public DtrdEntRdFlupTemplate parseFromDto(FlupTemplateDetail dto) {
        dataId = dto.getDataId();
        orgCode = dto.getOrgCode();
        templateName = dto.getTemplateName();
        packageDesc = dto.getPackageDesc();
        return this;
    }


}
